
from langchain_community.embeddings.dashscope import DashScopeEmbeddings

class EmbeddingUtil():  
    
    def __init__(self) -> None:
        pass
        
    def embed_documents(self,chunks):      
        pass
    
    
    def embed_query(self,query):        
        pass
    
class DashScopeEmbeddingUtil(EmbeddingUtil):  
    
    def __init__(self) -> None:
        self.embedding = DashScopeEmbeddings()
        
    def embed_documents(self,chunks):  
        embeddings = DashScopeEmbeddings()
        ret =  embeddings.embed_documents(chunks)
        # ret = self.embedding.embed_documents(chunks)
        return ret
    
    def embed_query(self,query):        
        return self.embedding.embed_query(query)